package com.company.cloud.club.modules.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
@Data
public class OssConfig {

    @Value("${aliyun.common.accessKey}")
    private String accessKey;

    @Value("${aliyun.common.accessSecret}")
    private String accessSecret;

    @Value("${aliyun.oss.static.endPoint}")
    private String endPoint;

    @Value("${aliyun.oss.static.bucket}")
    private String bucket;

    @Value("${aliyun.oss.static.bucketHost}")
    private String bucketHost;

    @Value("${aliyun.oss.static.bucketInternalHost}")
    private String bucketInternalHost;

    @Value("${aliyun.oss.static.bucketFastHost}")
    private String bucketFastHost;

    @Value("${aliyun.oss.static.callbackUrl}")
    private String callbackUrl;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endPoint, accessKey, accessSecret);
    }

}
